import React, {PureComponent} from 'react';
import {connect} from 'dva';
import {
    Form, Input, Button, Card, Select,Radio, Upload, Icon, Cascader,DatePicker
} from 'antd';
import styles from '../../../routes/style.less';
import {message} from "antd/lib/index";
import constants from '../../../common/constants';

const FormItem = Form.Item;
const RadioGroup = Radio.Group;
const { RangePicker } = DatePicker;
const { TextArea } = Input;

function getBase64(img, callback) {
    const reader = new FileReader();
    reader.addEventListener('load', () => callback(reader.result));
    reader.readAsDataURL(img);
}

@connect(state => ({
    submitting: state.goodsManage.loading,
}))
@Form.create()
export default class GoodsEdit extends PureComponent {
    state = {
        loading: false,
        goodsCategory: []
    };

    componentDidMount() {
        const {dispatch} = this.props;
        dispatch({
            type: 'goodsCategory/fetch',
            callback: (response) => {
                if (response.result === 0) {
                    let goodsCategory = [];
                    getCategorySList(goodsCategory,response.resultData.goodsCategoryList.list);
                    function getCategorySList(tmpR, list) {
                        for (var i = 0; i < list.length; i++) {
                            const categoryItem = {value:list[i]["cat_id"].toString(), label: list[i]["cat_name"]};
                            if (list[i]["children"]) {
                                categoryItem["children"] = [];
                                getCategorySList(categoryItem["children"], list[i]["children"]);
                            }
                            tmpR.push(categoryItem);
                        }
                    }
                    this.setState({
                        goodsCategory: goodsCategory
                    })
                } else {
                    message.success('失败');
                }
            }
        });
    }

    handleParentModalVisible = (e) => {
        this.props.handleModalVisible();
    }

    handleSubmit = (editType,e) => {
        this.props.form.validateFieldsAndScroll((err, values) => {
            console.log(values);
            // if (!err) {
            //     let user_id = '';
            // const userInfoState = sessionStorage.getItem("userInfoState");
          //     if (userInfoState !== null) {
            //         const {userInfo} = JSON.parse(userInfoState);
            //         user_id = userInfo.user_id;
            //     }
            //     this.props.dispatch({
            //         type: `brand/${editType}`,
            //         payload: {...values,brand_id: brand_id,add_user_id:user_id},
            //         callback: (response) => {
            //             if (response.result === 0) {
            //                 message.success('提交成功');
            //                 this.props.handleModalVisible();
            //                 this.props.handleModalSuccess(this.props.pagination);
            //             } else {
            //                 message.success('提交失败');
            //             }
            //         }
            //     });
            // }
        });
    }

    handleChange = (info) => {
        if (info.file.status === 'uploading') {
            this.setState({ loading: true });
            return;
        }
        if (info.file.status === 'done') {
            // Get this url from response in real world.
            getBase64(info.file.originFileObj, imageUrl => this.setState({
                imageUrl,
                loading: false,
            }));
        }
    }
    normFile = (e) => {
        console.log('Upload event:', e);
        if (Array.isArray(e)) {
            return e;
        }
        return e && `${constants.imageUrlFix}${e.file.response[0].fileUrl}`;
    }

    render() {
        const {submitting, record, editType } = this.props;
        const {getFieldDecorator, getFieldValue} = this.props.form;
        // const formInitValue = editType === 'add' ? '' : record;
        // const goods_id = editType === 'add' ? '' : record.goods_id;
        const formItemLayout = {
            labelCol: {
                xs: {span: 24},
                sm: {span: 7},
            },
            wrapperCol: {
                xs: {span: 24},
                sm: {span: 12},
                md: {span: 10},
            },
        };
        const submitFormLayout = {
            wrapperCol: {
                xs: {span: 24, offset: 0},
                sm: {span: 10, offset: 7},
            },
        };

        const uploadButton = (
            <div>
                <Icon type={this.state.loading ? 'loading' : 'plus'} />
                <div className="ant-upload-text">上传</div>
            </div>
        );
        const imageUrl = this.state.imageUrl;
        return (
            <Card bordered={false}>
                <Form
                    onSubmit={this.handleSubmit}
                    hideRequiredMark
                >
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="商品唯一货号"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_sn', {*/}
                            {/*initialValue:  formInitValue.goods_sn || '',*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请输入品牌名称',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品唯一货号"/>*/}
                        {/*)}<em className={styles.optional}>如果不填写则系统自动生成</em>*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品名称</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_name', {*/}
                            {/*initialValue:  formInitValue.goods_name || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品名称"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品分类</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('cat_id', {initialValue: []})(*/}
                            {/*<Cascader options={this.state.goodsCategory} changeOnSelect  />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                    {/*{...formItemLayout}*/}
                    {/*label={<span>商品分类</span>}*/}
                    {/*>*/}
                    {/*{getFieldDecorator('cat_id', {*/}
                    {/*initialValue:  formInitValue.cat_id || '',*/}
                    {/*rules: [{*/}
                    {/*}],*/}
                    {/*})(*/}
                    {/*<Cascader changeOnSelect options={this.state.goodsCategory} />*/}
                    {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品所属类型</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_type', {*/}
                            {/*initialValue:  formInitValue.goods_type || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Cascader changeOnSelect  />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品品牌</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('brand_id', {*/}
                            {/*initialValue:  formInitValue.brand_id || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Cascader changeOnSelect  />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品库存数量</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_number', {*/}
                            {/*initialValue:  formInitValue.goods_number || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品库存数量"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品的重量<em className={styles.optional}>（千克）</em></span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_weight', {*/}
                            {/*initialValue:  formInitValue.goods_weight || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品的重量"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>市场售价</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('market_price', {*/}
                            {/*initialValue:  formInitValue.market_price || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="市场售价"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>成本价</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('cost_price', {*/}
                            {/*initialValue:  formInitValue.cost_price || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="成本价"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>供货价</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('supply_price', {*/}
                            {/*initialValue:  formInitValue.supply_price || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="供货价"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>本店售价</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('shop_price', {*/}
                            {/*initialValue:  formInitValue.shop_price || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="本店售价"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>促销价格</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('promote_price', {*/}
                            {/*initialValue:  formInitValue.promote_price || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="促销价格"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="促销日期"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('promote_date', {*/}
                            {/*rules: [{ type: 'array' }],*/}
                        {/*})(*/}
                            {/*<RangePicker showTime format="YYYY-MM-DD HH:mm:ss" />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品报警数量</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('warn_number', {*/}
                            {/*initialValue:  formInitValue.warn_number || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品报警数量"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品关键字</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('keywords', {*/}
                            {/*initialValue:  formInitValue.keywords || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品关键字"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                    {/*{...formItemLayout}*/}
                    {/*label="微缩图片"*/}
                    {/*>*/}
                    {/*{getFieldDecorator('goods_thumb', {*/}
                    {/*initialValue:  formInitValue.goods_thumb || '',*/}
                    {/*getValueFromEvent: this.normFile,*/}
                    {/*rules: [{*/}
                    {/*required: true, message: '请上传Logo图片',*/}
                    {/*}],*/}
                    {/*})(*/}
                    {/*<Upload*/}
                    {/*name="avatar"*/}
                    {/*listType="picture-card"*/}
                    {/*className="avatar-uploader"*/}
                    {/*showUploadList={false}*/}
                    {/*action={constants.fileServer}*/}
                    {/*// defaultFileList={formInitValue.brand_logo}*/}
                    {/*// beforeUpload={beforeUpload}*/}
                    {/*onChange={this.handleChange}*/}
                    {/*>*/}
                    {/*{*/}
                    {/*!imageUrl ?*/}
                    {/*formInitValue.brand_logo ? <img src={formInitValue.brand_logo} alt="" /> : uploadButton*/}
                    {/*: <img src={imageUrl} alt="" />*/}
                    {/*}*/}

                    {/*</Upload>*/}
                    {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="实际大小图片"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_img', {*/}
                            {/*initialValue:  formInitValue.goods_img || '',*/}
                            {/*getValueFromEvent: this.normFile,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请上传Logo图片',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Upload*/}
                                {/*name="avatar"*/}
                                {/*listType="picture-card"*/}
                                {/*className="avatar-uploader"*/}
                                {/*showUploadList={false}*/}
                                {/*action={constants.fileServer}*/}
                                {/*// defaultFileList={formInitValue.brand_logo}*/}
                                {/*// beforeUpload={beforeUpload}*/}
                                {/*onChange={this.handleChange}*/}
                            {/*>*/}
                                {/*{*/}
                                    {/*!imageUrl ?*/}
                                        {/*formInitValue.brand_logo ? <img src={formInitValue.brand_logo} alt="" /> : uploadButton*/}
                                        {/*: <img src={imageUrl} alt="" />*/}
                                {/*}*/}

                            {/*</Upload>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否是实物"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_real', {*/}
                            {/*initialValue: !formInitValue.is_real ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>显示</Radio>*/}
                                {/*<Radio value={0}>不显示</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否开放销售"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_on_sale', {*/}
                            {/*initialValue: !formInitValue.is_on_sale ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否能单独销售"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_alone_sale', {*/}
                            {/*initialValue: !formInitValue.is_alone_sale ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="显示顺序"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('sort_order', {initialValue: formInitValue.sort_order || 100})(*/}
                            {/*<Input placeholder=""/>*/}
                        {/*)}<em className={styles.optional}>数字越大顺序越靠后</em>*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否删除"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_delete', {*/}
                            {/*initialValue: !formInitValue.is_delete ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否是精品"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_best', {*/}
                            {/*initialValue: !formInitValue.is_best ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否是新品"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_new', {*/}
                            {/*initialValue: !formInitValue.is_new ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否热销"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_hot', {*/}
                            {/*initialValue: !formInitValue.is_hot ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否特价促销"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_promote', {*/}
                            {/*initialValue: !formInitValue.is_promote ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>赠送积分</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('give_integral', {*/}
                            {/*initialValue:  formInitValue.give_integral || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="赠送积分"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>等级积分</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('rank_integral', {*/}
                            {/*initialValue:  formInitValue.rank_integral || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="等级积分"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="是否限购"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('is_xiangou', {*/}
                            {/*initialValue: !formInitValue.is_xiangou ? 0 : 1,*/}
                            {/*rules: [{*/}
                                {/*required: true, message: '请选择',*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<RadioGroup>*/}
                                {/*<Radio value={1}>是</Radio>*/}
                                {/*<Radio value={0}>否</Radio>*/}
                            {/*</RadioGroup>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label="限购时间"*/}
                    {/*>*/}
                        {/*{getFieldDecorator('xiangou_date', {*/}
                            {/*rules: [{ type: 'array' }],*/}
                        {/*})(*/}
                            {/*<RangePicker showTime format="YYYY-MM-DD HH:mm:ss" />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>限购设定数量</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('xiangou_num', {*/}
                            {/*initialValue:  formInitValue.xiangou_num || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="限购设定数量"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>商品标签</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_tag', {*/}
                            {/*initialValue:  formInitValue.goods_tag || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="商品标签"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>计量单位</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('measure_unit', {*/}
                            {/*initialValue:  formInitValue.measure_unit || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Input placeholder="计量单位"/>*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*{...formItemLayout}*/}
                        {/*label={<span>所属商家</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('from_seller_id', {*/}
                            {/*initialValue:  formInitValue.from_seller_id || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<Cascader changeOnSelect  />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*label={<span>商品的简短描述</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_brief', {*/}
                            {/*initialValue:  formInitValue.goods_brief || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<TextArea rows={2} />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*label={<span>商品的详细描述</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('goods_desc', {*/}
                            {/*initialValue:  formInitValue.goods_desc || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<TextArea rows={4} />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    {/*<FormItem*/}
                        {/*label={<span>商品的商家备注</span>}*/}
                    {/*>*/}
                        {/*{getFieldDecorator('seller_note', {*/}
                            {/*initialValue:  formInitValue.seller_note || '',*/}
                            {/*rules: [{*/}
                            {/*}],*/}
                        {/*})(*/}
                            {/*<TextArea rows={4} />*/}
                        {/*)}*/}
                    {/*</FormItem>*/}
                    <FormItem {...submitFormLayout} style={{marginTop: 32}}>
                        <Button type="primary" loading={submitting} onClick={this.handleSubmit.bind(this,editType)}>
                            提交
                        </Button>
                        <Button style={{marginLeft: 8}} onClick={this.handleParentModalVisible}>取消</Button>
                    </FormItem>
                </Form>
            </Card>
        );
    }
}
